gtk4.git
6 years agoentry: Remove some unused constants
Timm Bäder [Sat, 13 Apr 2019 04:18:43 +0000 (06:18 +0200)]
entry: Remove some unused constants

6 years agogl renderer: Declare color matrix child separately
Timm Bäder [Sun, 31 Mar 2019 05:50:33 +0000 (07:50 +0200)]
gl renderer: Declare color matrix child separately

Otherwise I'm doing this all the time when debugging.

6 years agoMerge branch 'listbox-separators' into 'master'
Benjamin Otte [Sat, 13 Apr 2019 00:38:14 +0000 (00:38 +0000)]
Merge branch 'listbox-separators' into 'master'

Listbox separators

See merge request GNOME/gtk!747

6 years agoMerge branch 'test-locale-change' into 'master'
Matthias Clasen [Sat, 13 Apr 2019 00:28:08 +0000 (00:28 +0000)]
Merge branch 'test-locale-change' into 'master'

testutils: Run in UTF8 locale

See merge request GNOME/gtk!734

6 years agoinspector: Use the new show-separators property
Matthias Clasen [Sat, 13 Apr 2019 00:25:54 +0000 (20:25 -0400)]
inspector: Use the new show-separators property

Add separators to the list boxes on the Settings page.

6 years agoAdwaita: Implement list separators
Matthias Clasen [Sat, 13 Apr 2019 00:25:16 +0000 (20:25 -0400)]
Adwaita: Implement list separators

Just put a top border on every row.

6 years agolistbox: Add a ::show-separators property
Matthias Clasen [Sat, 13 Apr 2019 00:24:40 +0000 (20:24 -0400)]
listbox: Add a ::show-separators property

This is getting translated into a .separators style
class on the list box css node.

6 years agoMerge branch 'fix-reftests' into 'master'
Benjamin Otte [Sat, 13 Apr 2019 00:02:19 +0000 (00:02 +0000)]
Merge branch 'fix-reftests' into 'master'

Fix reftests

See merge request GNOME/gtk!746

6 years agoreftests: Be more graceful about errors
Benjamin Otte [Fri, 12 Apr 2019 23:48:28 +0000 (01:48 +0200)]
reftests: Be more graceful about errors

The nice thing about that is that we can then log messages about the
errors to the log.

And then we can read the logs of the CI machinery and actually know
what's going on.

6 years agoinspector: Fix editing in the property list
Matthias Clasen [Fri, 12 Apr 2019 23:48:23 +0000 (19:48 -0400)]
inspector: Fix editing in the property list

The type-to-search was interfering with using
entries in the list. Avoid that by watching
where the focus is.

6 years agotestutils: Run in UTF8 locale
Benjamin Otte [Fri, 12 Apr 2019 04:08:28 +0000 (06:08 +0200)]
testutils: Run in UTF8 locale

before, code was using the "C" locale, but that one uses ASCII. Instead,
run in the "C.utf8" locale.

Nobody expects code to not support UTF8 and no end user runs their
machine in an ASCII setup, so it makes no sense to default to that.

6 years agotestsuite: Fix label-shadows test
Benjamin Otte [Fri, 12 Apr 2019 23:31:49 +0000 (01:31 +0200)]
testsuite: Fix label-shadows test

Use a GtkFixed to position and rotate the labels. This is necessary
because the GtkLabel::angle property was removed.

6 years agoMerge branch 'gtkcomposetable-checked-mul' into 'master'
Matthias Clasen [Fri, 12 Apr 2019 22:19:31 +0000 (22:19 +0000)]
Merge branch 'gtkcomposetable-checked-mul' into 'master'

gtkcomposetable: use g_size_checked_mul() for overflow checking

See merge request GNOME/gtk!745

6 years agoreftests: Fix textview-margins test
Benjamin Otte [Fri, 12 Apr 2019 20:00:53 +0000 (22:00 +0200)]
reftests: Fix textview-margins test

The text is wider now that we changed the font properties, so account
for that.

6 years agogtkcomposetable: use g_size_checked_mul() for overflow checking
Christoph Reiter [Fri, 12 Apr 2019 20:38:44 +0000 (22:38 +0200)]
gtkcomposetable: use g_size_checked_mul() for overflow checking

The check was added in !741, this replaces it with g_size_checked_mul()

6 years agoRevert "reftests: Fix textview-margins test"
Benjamin Otte [Fri, 12 Apr 2019 20:38:11 +0000 (22:38 +0200)]
Revert "reftests: Fix textview-margins test"

This reverts commit c6471ee874702d4c4c2ec49d7a299926606461e9.

Doesn't work on CI.

6 years agoreftests: Fix textview-margins test
Benjamin Otte [Fri, 12 Apr 2019 20:00:53 +0000 (22:00 +0200)]
reftests: Fix textview-margins test

The text is wider now that we changed the font properties, so account
for that.

6 years agoMerge branch 'cache-reftest-images' into 'master'
Emmanuele Bassi [Fri, 12 Apr 2019 20:09:50 +0000 (20:09 +0000)]
Merge branch 'cache-reftest-images' into 'master'

ci: Cache the reftest artifacts

See merge request GNOME/gtk!744

6 years agoci: Cache the reftest artifacts
Emmanuele Bassi [Fri, 12 Apr 2019 19:58:29 +0000 (20:58 +0100)]
ci: Cache the reftest artifacts

Keeping the reftest output images as artifacts of a job allows us to
browse them and download them straight from GitLab.

6 years agoMerge branch 'ci-update' into 'master'
Emmanuele Bassi [Fri, 12 Apr 2019 19:30:31 +0000 (19:30 +0000)]
Merge branch 'ci-update' into 'master'

ci: Install Monospace fonts

See merge request GNOME/gtk!742

6 years agoMerge branch 'fix-meson-on-macos-2' into 'master'
Emmanuele Bassi [Fri, 12 Apr 2019 19:30:19 +0000 (19:30 +0000)]
Merge branch 'fix-meson-on-macos-2' into 'master'

reftests: Use shared_library, not shared_module

See merge request GNOME/gtk!743

6 years agoci: Update list of xfail tests
Emmanuele Bassi [Fri, 12 Apr 2019 19:21:29 +0000 (20:21 +0100)]
ci: Update list of xfail tests

The label tests do not fail any more, because the CI image has Monospace
fonts; the textview-margins test started to fail on the CI image,
though.

6 years agoMerge branch 'validate-alloc-size' into 'master'
Matthias Clasen [Fri, 12 Apr 2019 19:11:30 +0000 (19:11 +0000)]
Merge branch 'validate-alloc-size' into 'master'

Check the size of the g_new arguments

See merge request GNOME/gtk!741

6 years agoci: Install Monospace fonts
Emmanuele Bassi [Fri, 12 Apr 2019 19:03:11 +0000 (20:03 +0100)]
ci: Install Monospace fonts

The reftests require them.

6 years agoinspector: Show readonly property values
Matthias Clasen [Fri, 12 Apr 2019 19:07:01 +0000 (15:07 -0400)]
inspector: Show readonly property values

6 years agoinspector: Cosmetics
Matthias Clasen [Fri, 12 Apr 2019 18:56:23 +0000 (14:56 -0400)]
inspector: Cosmetics

6 years agoinspector: Revamp attribute and action info
Matthias Clasen [Fri, 12 Apr 2019 18:34:11 +0000 (14:34 -0400)]
inspector: Revamp attribute and action info

This also needs to be turned into single-line data.

6 years agoFix a crash
Matthias Clasen [Fri, 12 Apr 2019 17:58:33 +0000 (13:58 -0400)]
Fix a crash

We had a signal handler with a wrong signature, causing
a crash when looking  at the GtkSettings properties in
the inspector.

6 years agoreftests: Use shared_library, not shared_module
James Westman [Fri, 12 Apr 2019 19:04:01 +0000 (14:04 -0500)]
reftests: Use shared_library, not shared_module

This allows Meson to run on macOS, where shared modules cannot be linked
against.

6 years agoMerge branch 'default-request-mode' into 'master'
Emmanuele Bassi [Fri, 12 Apr 2019 17:59:04 +0000 (17:59 +0000)]
Merge branch 'default-request-mode' into 'master'

Add default GtkLayoutManagerClass.get_request_mode()

See merge request GNOME/gtk!738

6 years agoCheck the size of the g_new arguments
Emmanuele Bassi [Fri, 12 Apr 2019 17:54:20 +0000 (18:54 +0100)]
Check the size of the g_new arguments

We're passing integers without validating their size, and newer GCC are
very cross about it, with warnings like:

    warning: argument 1 range [1844674407156206796818446744073709551615]
    exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]

We should check we're not overflowing the allocation size, by limiting
the range of values we can use.

First of all, we need to use `gsize` instead of a random `int`, since we're
allocating data.

Additionally, we need to check that the multiplication that computes the
size of the allocation doesn't overflow the maximum value of a `gsize`.

6 years agoCI: Turn on reftests
Benjamin Otte [Fri, 12 Apr 2019 16:03:46 +0000 (18:03 +0200)]
CI: Turn on reftests

6 years agoreftests: Mark the currently unfixed failures as XFAIL
Benjamin Otte [Fri, 12 Apr 2019 16:01:45 +0000 (18:01 +0200)]
reftests: Mark the currently unfixed failures as XFAIL

They should be fixeed before 4.0 but the fixes are more involved. And we
want to start running the existing tests on CI, because they break
regularly and we want to catch that.

6 years agoreftests: Fix GtkFixed layout properties
Benjamin Otte [Fri, 12 Apr 2019 04:48:28 +0000 (06:48 +0200)]
reftests: Fix GtkFixed layout properties

GtkFixed was still using "x" and "y", when it should have been using
"position".

6 years agoreftests: Fix CSS for various tests
Benjamin Otte [Fri, 12 Apr 2019 03:25:51 +0000 (05:25 +0200)]
reftests: Fix CSS for various tests

* :nth-child(first) => :first-child
* :nth-child(last) => :last-child
* Add semicolons at end of declarations
* Remove spaces between color functions (shade, alpha, ...) and args

6 years agotests: Remove testboxcss
Benjamin Otte [Fri, 12 Apr 2019 03:30:14 +0000 (05:30 +0200)]
tests: Remove testboxcss

That test was cool in 2011, but hasn't been updated or used since then
because its features are now part of widget-factory and the inspector.

So let's remove it.

6 years agobuilder: Parse GskTransform properties
Benjamin Otte [Fri, 12 Apr 2019 03:13:30 +0000 (05:13 +0200)]
builder: Parse GskTransform properties

In particular, this allows parsing the GtkFixed position properties.

6 years agotransform: Add gsk_transform_parse()
Benjamin Otte [Thu, 21 Mar 2019 04:52:41 +0000 (05:52 +0100)]
transform: Add gsk_transform_parse()

It uses the new CSS parser.

6 years agotestsuite: Fix stylecontext test
Benjamin Otte [Thu, 11 Apr 2019 20:41:04 +0000 (22:41 +0200)]
testsuite: Fix stylecontext test

Update the test to the stricter interpretation of the CSS specification
and the removal of custom additions.

6 years agotestsuite: Update references for style test
Benjamin Otte [Thu, 11 Apr 2019 19:11:39 +0000 (21:11 +0200)]
testsuite: Update references for style test

We have more accurate section printouts now and they are used here.

6 years agotestsuite: Check errors not just for line, but for full range
Benjamin Otte [Thu, 11 Apr 2019 02:33:08 +0000 (04:33 +0200)]
testsuite: Check errors not just for line, but for full range

Instead of just checking that the line of the error message is correct,
assert that start and end position are on the correct character offset.

Also fix all the tests to conform to this.

6 years agotestsuite: Update integer test
Benjamin Otte [Thu, 11 Apr 2019 18:45:17 +0000 (20:45 +0200)]
testsuite: Update integer test

Make the test use an actual integer property that accepts negative
numbers (opacity) instead of one that wants units (margin-top) or
can't deal with negative numbers (everything else).

6 years agoselector: Inlcude : sign when reporting errors
Benjamin Otte [Thu, 11 Apr 2019 17:44:46 +0000 (19:44 +0200)]
selector: Inlcude : sign when reporting errors

6 years agocssprovider: Mark whole @import statement on import error
Benjamin Otte [Thu, 11 Apr 2019 04:10:52 +0000 (06:10 +0200)]
cssprovider: Mark whole @import statement on import error

6 years agocalc: Have better error location range
Benjamin Otte [Thu, 11 Apr 2019 02:31:36 +0000 (04:31 +0200)]
calc: Have better error location range

6 years agocsspositionvalue: Redo the parser
Benjamin Otte [Wed, 10 Apr 2019 19:10:03 +0000 (21:10 +0200)]
csspositionvalue: Redo the parser

The old one incorrectly rejected "center left" and "center right".

6 years agocssparser: Add error functions that take locations
Benjamin Otte [Wed, 10 Apr 2019 17:42:09 +0000 (19:42 +0200)]
cssparser: Add error functions that take locations

... and use them to report better error locations for the warning when
blocks aren't terminated properly.

6 years agocss: Move gtkcsssection.[ch] into gtk/css
Benjamin Otte [Wed, 10 Apr 2019 16:40:50 +0000 (18:40 +0200)]
css: Move gtkcsssection.[ch] into gtk/css

6 years agocssparser: Pass in error locations explicitly
Benjamin Otte [Wed, 10 Apr 2019 16:16:10 +0000 (18:16 +0200)]
cssparser: Pass in error locations explicitly

And for the quick function, use the start/end location of the current
token.

6 years agocssprovider: Redo error emission
Benjamin Otte [Wed, 10 Apr 2019 16:01:56 +0000 (18:01 +0200)]
cssprovider: Redo error emission

Emit all errors via the parser, don't try to have a custom error
handling machinery.

The only exception is the initial file load error - we need to do that
one directly, because there is no parser.

6 years agocsssection: Make printing functions public
Benjamin Otte [Wed, 10 Apr 2019 15:23:14 +0000 (17:23 +0200)]
csssection: Make printing functions public

6 years agocssprovider: Advance parser to start of declaration
Benjamin Otte [Wed, 10 Apr 2019 15:07:06 +0000 (17:07 +0200)]
cssprovider: Advance parser to start of declaration

This way, the block will reference the right location.

6 years agocssprovider: Change section handling
Benjamin Otte [Wed, 10 Apr 2019 14:37:52 +0000 (16:37 +0200)]
cssprovider: Change section handling

Instead of building a full tree of sections that then nobody cares
about, just create sections as necessary for when we use it in the
inspector.

6 years agocssparser: Improve location APIs
Benjamin Otte [Wed, 10 Apr 2019 14:02:07 +0000 (16:02 +0200)]
cssparser: Improve location APIs

1. Export multiple locations
2. Return the location instead of passing one in

6 years agocssection: Return locations, not numbers
Benjamin Otte [Wed, 10 Apr 2019 03:18:14 +0000 (05:18 +0200)]
cssection: Return locations, not numbers

Now that we have GtkCssLocation, actually use it.

6 years agocss: Remove GtkCssSectionType
Benjamin Otte [Wed, 10 Apr 2019 02:55:37 +0000 (04:55 +0200)]
css: Remove GtkCssSectionType

It's unused.

6 years agocsssection: Redo constructors
Benjamin Otte [Wed, 10 Apr 2019 01:51:40 +0000 (03:51 +0200)]
csssection: Redo constructors

Remove the unused one and rename the old one to new_from_parser().

6 years agocsssection: Store a GtkCssLocation
Benjamin Otte [Wed, 10 Apr 2019 00:59:15 +0000 (02:59 +0200)]
csssection: Store a GtkCssLocation

6 years agocss: Review error messages
Benjamin Otte [Tue, 9 Apr 2019 03:40:50 +0000 (05:40 +0200)]
css: Review error messages

... and move them from _gtk_css_parser_error() to the proper new error
message.

6 years agocss: Use gtk_css_parser_consume_any() for transition shorthand
Benjamin Otte [Tue, 9 Apr 2019 22:08:57 +0000 (00:08 +0200)]
css: Use gtk_css_parser_consume_any() for transition shorthand

6 years agotestsuite: Update parser tests to new errors
Benjamin Otte [Tue, 9 Apr 2019 04:54:10 +0000 (06:54 +0200)]
testsuite: Update parser tests to new errors

Some errors are now properly detected as unknown values when previously
they were just treated as syntax errors.

6 years agotestsuite: Handle warnings in CSS tests
Benjamin Otte [Tue, 9 Apr 2019 04:37:32 +0000 (06:37 +0200)]
testsuite: Handle warnings in CSS tests

6 years agocssshadow: Use gtk_css_parser_consume_any()
Benjamin Otte [Tue, 9 Apr 2019 03:15:45 +0000 (05:15 +0200)]
cssshadow: Use gtk_css_parser_consume_any()

This way, the arguments can now really be speicified in any order.

A new testcase testing all the ordering possibilities has been added.

6 years agocss: Redo for new parser
Benjamin Otte [Tue, 9 Apr 2019 02:47:00 +0000 (04:47 +0200)]
css: Redo for new parser

This commit is still way too big, but I couldn't make it smaller.

It transitions the old CSS parser to the new parser. CSS parsing is now
tokenized, everything else is probably still buggy.

6 years agorgba: Add gdk_rgba_parser_parse()
Benjamin Otte [Sat, 6 Apr 2019 00:40:29 +0000 (02:40 +0200)]
rgba: Add gdk_rgba_parser_parse()

This function is a (private) function to parse a GdkRGBA accoridng to
the CSS specs. We should probably use it for gdk_rgba_parse(), but that
would change the syntax we accept there...

This also introduces a dependency of libgdk on libgtkcss.

So far, no users for this function exist.

6 years agoResurrect the CSS parser from the tokenizer branch
Benjamin Otte [Tue, 19 Mar 2019 04:46:59 +0000 (05:46 +0100)]
Resurrect the CSS parser from the tokenizer branch

So far that parser is unused.

6 years agocssparser: Add gtk_css_parser_consume_url()
Benjamin Otte [Tue, 9 Apr 2019 00:29:27 +0000 (02:29 +0200)]
cssparser: Add gtk_css_parser_consume_url()

Another slight renaming and semantics change.

6 years agocssparser: Add gtk_css_parser_resolve_url()
Benjamin Otte [Tue, 9 Apr 2019 00:15:12 +0000 (02:15 +0200)]
cssparser: Add gtk_css_parser_resolve_url()

Another slight change of semantics and naming for the new parser.

6 years agocssparser: Split integer gettig into has/consume functions
Benjamin Otte [Fri, 5 Apr 2019 11:41:08 +0000 (13:41 +0200)]
cssparser: Split integer gettig into has/consume functions

We can't try to get an integer because ultimately integer getters
support the same shenanigans that numbers and percentages do with calc()
and whatnot.

6 years agocssparser: Add gtk_css_parser_try_delim()
Benjamin Otte [Fri, 5 Apr 2019 00:57:14 +0000 (02:57 +0200)]
cssparser: Add gtk_css_parser_try_delim()

For parsing single code point delimiters. Also port calc() to use this.

6 years agocssparser: Get rid of _gtk_css_parser_try_double()
Benjamin Otte [Fri, 5 Apr 2019 00:16:00 +0000 (02:16 +0200)]
cssparser: Get rid of _gtk_css_parser_try_double()

Use gtk_css_parser_consume_number() everywhere instead.

6 years agocssparser: Add gtk_css_parser_consume_string()
Benjamin Otte [Thu, 4 Apr 2019 21:37:38 +0000 (23:37 +0200)]
cssparser: Add gtk_css_parser_consume_string()

Well, just rename _gtk_css_parser_read_string() for the new semantics,
but this sounds cooler.

6 years agocssparser: Add gtk_css_parser_try_at_keyword()
Benjamin Otte [Mon, 1 Apr 2019 22:21:02 +0000 (00:21 +0200)]
cssparser: Add gtk_css_parser_try_at_keyword()

6 years agocssparser: Drop _gtk_css_parser_has_prefix()
Benjamin Otte [Mon, 1 Apr 2019 09:47:53 +0000 (11:47 +0200)]
cssparser: Drop _gtk_css_parser_has_prefix()

Replace it with has_ident/has_function. The old function is a typical
string matching API, not a tokenizing one.

6 years agoparser: Get rid of _gtk_css_parser_is_eof()
Benjamin Otte [Sun, 31 Mar 2019 21:22:18 +0000 (23:22 +0200)]
parser: Get rid of _gtk_css_parser_is_eof()

Use gtk_css_parser_has_token() instead.

6 years agocss: Make font-weight an integer
Benjamin Otte [Sun, 31 Mar 2019 18:05:12 +0000 (20:05 +0200)]
css: Make font-weight an integer

This conforms to what Pango does and to the CSS4 spec. And it makes the
parsing code easier. So let's go for it.

6 years agocssimagescaled: Use gtk_css_parser_consume_function()
Benjamin Otte [Sun, 31 Mar 2019 17:24:53 +0000 (19:24 +0200)]
cssimagescaled: Use gtk_css_parser_consume_function()

As part of that, adapt the syntax from
  -gtk-scaled( [<image>, <int>?]# )
to
  -gtk-scaled( [<image> <int>?]# )

because the commas should be used to separate distinct elements.

Note that almost nobody specifies the scale anyway.

6 years agoeasevalue: Use gtk_css_parser_consume_function()
Benjamin Otte [Sun, 31 Mar 2019 12:41:45 +0000 (14:41 +0200)]
easevalue: Use gtk_css_parser_consume_function()

6 years agocssimagelinear: Use gtk_css_parser_consume_function()
Benjamin Otte [Sun, 31 Mar 2019 11:39:58 +0000 (13:39 +0200)]
cssimagelinear: Use gtk_css_parser_consume_function()

6 years agocssparser: Add gtk_css_parser_consume_ident()
Benjamin Otte [Sun, 31 Mar 2019 10:40:53 +0000 (12:40 +0200)]
cssparser: Add gtk_css_parser_consume_ident()

And use it to fix the palette parser.

6 years agoshorthand: Use gtk_css_parser_try_ident()
Benjamin Otte [Sun, 31 Mar 2019 09:39:24 +0000 (11:39 +0200)]
shorthand: Use gtk_css_parser_try_ident()

6 years agocssimageradial: Use gtk_css_parser_consume_function()
Benjamin Otte [Sun, 31 Mar 2019 00:17:44 +0000 (01:17 +0100)]
cssimageradial: Use gtk_css_parser_consume_function()

6 years agocssimagefallback: Use gtk_css_parser_consume_function()
Benjamin Otte [Sat, 30 Mar 2019 23:52:22 +0000 (00:52 +0100)]
cssimagefallback: Use gtk_css_parser_consume_function()

6 years agocssimagerecolor: Use gtk_css_parser_consume_function()
Benjamin Otte [Sat, 30 Mar 2019 19:20:11 +0000 (20:20 +0100)]
cssimagerecolor: Use gtk_css_parser_consume_function()

6 years agoreftests: Add a cross-fade syntax-checking reftest
Benjamin Otte [Sat, 30 Mar 2019 19:13:11 +0000 (20:13 +0100)]
reftests: Add a cross-fade syntax-checking reftest

Making sure all this newfangled code does what it says.

6 years agocross-fade: Make progress optional
Benjamin Otte [Sat, 30 Mar 2019 15:02:58 +0000 (16:02 +0100)]
cross-fade: Make progress optional

Now we accept progress being unset and then dynamically compute it
on-demand.

6 years agocross-fade: Use gtk_css_parser_consume_any()
Benjamin Otte [Sat, 30 Mar 2019 11:04:51 +0000 (12:04 +0100)]
cross-fade: Use gtk_css_parser_consume_any()

.. and gtk_css_parser_consume_function().

gtk_css_parser_consume_any() is a new function that implements the CSS
spec's any combinator ||.

6 years agocssimage: Make cross-fade() an array
Benjamin Otte [Tue, 26 Mar 2019 16:39:07 +0000 (17:39 +0100)]
cssimage: Make cross-fade() an array

The new spec at https://drafts.csswg.org/css-images-4/#cross-fade-function
allows infinite images to cross-fade and we want to, too.

6 years agocssimageicontheme: Use gtk_css_parser_consume_function()
Benjamin Otte [Mon, 25 Mar 2019 03:11:08 +0000 (04:11 +0100)]
cssimageicontheme: Use gtk_css_parser_consume_function()

6 years agocssfiltervalue: Use gtk_css_parser_consume_function()
Benjamin Otte [Sun, 24 Mar 2019 23:40:59 +0000 (00:40 +0100)]
cssfiltervalue: Use gtk_css_parser_consume_function()

6 years agocsstransformvalue: Use gtk_css_parser_consume_function()
Benjamin Otte [Sun, 24 Mar 2019 21:59:10 +0000 (22:59 +0100)]
csstransformvalue: Use gtk_css_parser_consume_function()

6 years agocssparser: Introduce gtk_css_parser_consume_function()
Benjamin Otte [Sun, 24 Mar 2019 20:11:53 +0000 (21:11 +0100)]
cssparser: Introduce gtk_css_parser_consume_function()

This is a vfunc-based function parser.

6 years agocssparser: Add gtk_css_parser_try_token()
Benjamin Otte [Sun, 24 Mar 2019 13:36:55 +0000 (14:36 +0100)]
cssparser: Add gtk_css_parser_try_token()

6 years agocssparser: Introduce gtk_css_parser_try_ident()
Benjamin Otte [Sun, 24 Mar 2019 13:03:52 +0000 (14:03 +0100)]
cssparser: Introduce gtk_css_parser_try_ident()

... and gtk_css_parser_has_function().

6 years agocssparser: Get rid of _gtk_css_parser_begins_with()
Benjamin Otte [Sun, 24 Mar 2019 02:56:31 +0000 (03:56 +0100)]
cssparser: Get rid of _gtk_css_parser_begins_with()

Replace it with calls to gtk_css_parser_has_token().

6 years agoparser: Add gtk_css_parser_has_token()
Benjamin Otte [Sat, 23 Mar 2019 17:21:59 +0000 (18:21 +0100)]
parser: Add gtk_css_parser_has_token()

This is ithe first step towards converting the parsing code to use
tokens. For now, the topken type is just a magic enum value that only
works as-needed.

6 years agocss: Split GtkCssLocation into its own file
Benjamin Otte [Sat, 23 Mar 2019 02:27:56 +0000 (03:27 +0100)]
css: Split GtkCssLocation into its own file

And make the struct public, so we can use it in signal handlers.

6 years agocsstokenizer: Add gtk_css_token_is_preserved()
Benjamin Otte [Mon, 18 Mar 2019 04:32:05 +0000 (05:32 +0100)]
csstokenizer: Add gtk_css_token_is_preserved()

6 years agotokenizer: Pass error arg to read_token()
Benjamin Otte [Fri, 15 Mar 2019 03:00:21 +0000 (04:00 +0100)]
tokenizer: Pass error arg to read_token()

Instead of an error vfunc, have the tokenizer vfunc take a GError
argument. Note that even when an error is returned, there is still a
token to be read.

6 years agocss: Add GtkCssTokenizer
Benjamin Otte [Fri, 4 Mar 2016 17:40:11 +0000 (18:40 +0100)]
css: Add GtkCssTokenizer

This is copied from an old branch of mine.